<template>
  <DesignContainer />
</template>

<script lang="ts">
import { useQuestTypeChoseStore } from '@/store/create';
import { useDesignContentStore, useDesignSliderStore } from '@/store/design';
import { useDesignEditStore } from '@/store/design/edit';
import { defineComponent } from 'vue';
import { useRoute } from 'vue-router';
import DesignContainer from './DesignContainer.vue';
export default defineComponent({
  components: { DesignContainer },
  props: {},
  emits: [],
  setup() {
    const route = useRoute();
    const sliderStore = useDesignSliderStore();
    const useTypeStore = useQuestTypeChoseStore();
    const contentStore = useDesignContentStore();
    const queId = route.query.queId as string | undefined;
    const editStore = useDesignEditStore();

    if (queId) {
      // 编辑
      editStore.init(queId);
    } else {
      // 新建
      contentStore.reSet();
      editStore.setEdit(false);
      sliderStore.getExamType((useTypeStore.selectType.id + 1).toString());
    }

    return {};
  },
});
</script>
<style lang="less" scoped></style>
